package index;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Partitioner;

/**
 * @author Guimin Lin
 * @date Feb 18, 2011
 */
public class IndexPartitioner implements Partitioner<Text, Text>{

	@Override
	public void configure(JobConf job) {
		
	}

	@Override
	public int getPartition(Text key, Text value, int numPartitions) {
		return Math.abs(value.toString().hashCode()%numPartitions);
	}


}
